home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / atarifb.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  32KB  |  944 lines

  1. /***************************************************************************
  2.  
  3. Atari Football Driver
  4.  
  5. Driver by Mike Balfour, Patrick Lawrence, Brad Oliver
  6.  
  7. Memory Map:
  8.     0000-01FF    Working RAM
  9.     0200-025F    Playfield - Player 1
  10.     03A0-03FF    Playfield - Player 2
  11.     1000-13BF    Scrollfield
  12.     13C0-13FF    Motion Object Parameters:
  13.  
  14.     13C0        Motion Object 1 Picture #
  15.     13C1        Motion Object 1 Vertical Position
  16.     13C2        Motion Object 2 Picture #
  17.     13C3        Motion Object 2 Vertical Position
  18.     ...
  19.     13DE        Motion Object 16 Picture #
  20.     13DF        Motion Object 16 Vertical Position
  21.  
  22.     13E0        Motion Object 1 Horizontal Position
  23.     13E1        Spare
  24.     13E2        Motion Object 2 Horizontal Position
  25.     13E3        Spare
  26.     ...
  27.     13FE        Motion Object 16 Horizontal Position
  28.     13FF        Spare
  29.  
  30.     2000-2003    Output ports:
  31.  
  32.     2000        (OUT 0) Scrollfield Offset (8 bits)
  33.     2001        (OUT 1)
  34.                 D0 = Whistle
  35.                 D1 = Hit
  36.                 D2 = Kicker
  37.                 D5 = CTRLD
  38.     2002        (OUT 2)
  39.                 D0-D3 = Noise Amplitude
  40.                 D4 = Coin Counter
  41.                 D5 = Attract
  42.     2003        (OUT 3)
  43.                 D0-D3 = LED Cathodes
  44.                 D4-D5 Spare
  45.  
  46.     3000        Interrupt Acknowledge
  47.     4000-4003    Input ports:
  48.  
  49.     4000        (IN 0) = 0
  50.                 D0 = Trackball Direction PL2VD
  51.                 D1 = Trackball Direction PL2HD
  52.                 D2 = Trackball Direction PL1VD
  53.                 D3 = Trackball Direction PL1HD
  54.                 D4 = Select 1
  55.                 D5 = Slam
  56.                 D6 = End Screen
  57.                 D7 = Coin 1
  58.     4000        (CTRLD) = 1
  59.                 D0-D3 = Track-ball Horiz. 1
  60.                 D4-D7 = Track-ball Vert. 1
  61.     4002        (IN 2) = 0
  62.                 D0-D3 = Option Switches
  63.                 D4 = Select 2
  64.                 D5 = Spare
  65.                 D6 = Test
  66.                 D7 = Coin 2
  67.     4002        (CTRLD) = 1
  68.                 D0-D3 = Track-ball Horiz. 2
  69.                 D4-D7 = Track-ball Vert. 2
  70.  
  71.     5000        Watchdog
  72.     6800-7FFF    Program
  73.     (F800-FFFF) - only needed for the 6502 vectors
  74.  
  75. If you have any questions about how this driver works, don't hesitate to
  76. ask.  - Mike Balfour (mab22@po.cwru.edu)
  77.  
  78. Changes:
  79.     LBO - lots of cleanup, now it's playable.
  80.  
  81. TODO:
  82.     * The down marker sprite is multiplexed so that it will be drawn at the
  83.       top and bottom of the screen. We fake this feature. Additionally, we
  84.       draw it at a different location which seems to make more sense.
  85.  
  86.     * The play which is chosen is drawn in text at the top of the screen;
  87.       no backdrop/overlay is supported yet. High quality artwork would be
  88.       appreciated.
  89.  
  90.     * The sound is ripped for the most part from the Basketball driver and
  91.       is missing the kick, hit and whistle tones. I don't know if the noise
  92.       is entirely accurate either.
  93.  
  94.     * I'm not good at reading the schematics, so I'm unsure about the
  95.       exact vblank duration. I'm pretty sure it is one of two values though.
  96.  
  97.     * The 4-player variation is slightly broken. I'm unsure of the
  98.       LED multiplexing.
  99.  
  100. ***************************************************************************/
  101.  
  102. #include "driver.h"
  103. #include "vidhrdw/generic.h"
  104.  
  105. /* vidhrdw/atarifb.c */
  106. extern size_t atarifb_alphap1_vram_size;
  107. extern size_t atarifb_alphap2_vram_size;
  108. extern unsigned char *atarifb_alphap1_vram;
  109. extern unsigned char *atarifb_alphap2_vram;
  110. extern unsigned char *atarifb_scroll_register;
  111.  
  112. WRITE_HANDLER( atarifb_scroll_w );
  113. WRITE_HANDLER( atarifb_alphap1_vram_w );
  114. WRITE_HANDLER( atarifb_alphap2_vram_w );
  115. extern int atarifb_vh_start(void);
  116. extern void atarifb_vh_stop(void);
  117. extern void atarifb_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  118.  
  119. /* machine/atarifb.c */
  120. WRITE_HANDLER( atarifb_out1_w );
  121. READ_HANDLER( atarifb_in0_r );
  122. READ_HANDLER( atarifb_in2_r );
  123. WRITE_HANDLER( atarifb4_out1_w );
  124. READ_HANDLER( atarifb4_in0_r );
  125. READ_HANDLER( atarifb4_in2_r );
  126. WRITE_HANDLER( soccer_out1_w );
  127.  
  128. int atarifb_lamp1, atarifb_lamp2;
  129. int atarifb_game;
  130.  
  131. /* sound code shamelessly ripped from bsktball.c */
  132. static int crowd_mask;
  133. static int noise_b10=0;
  134. static int noise_a10=0;
  135. static int noise=0;
  136. static int noise_timer_set=0;
  137. #define TIME_32H 10582*2
  138. #define TIME_256H TIME_32H*4
  139.  
  140.  
  141. static void atarifb_noise_256H(int foo)
  142. {
  143.     int b10_input;
  144.     int a10_input;
  145.  
  146.     b10_input = (noise_b10 & 0x01) ^ (((~noise_a10) & 0x40) >> 6);
  147.     a10_input = (noise_b10 & 0x80) >> 7;
  148.  
  149.     noise_b10 = ((noise_b10 << 1) | b10_input) & 0xFF;
  150.     noise_a10 = ((noise_a10 << 1) | a10_input) & 0xFF;
  151.  
  152.     noise = (noise_a10 & 0x80) >> 7;
  153.  
  154.     if (noise)
  155.         DAC_data_w(2,crowd_mask);
  156.     else
  157.         DAC_data_w(2,0);
  158.  
  159.     timer_set (TIME_IN_NSEC(TIME_256H), 0, atarifb_noise_256H);
  160.     noise_timer_set=1;
  161. }
  162.  
  163. static WRITE_HANDLER( atarifb_out2_w )
  164. {
  165.     /* D0-D3 = crowd */
  166.     crowd_mask = (data & 0x0F) << 4;
  167.     if (noise)
  168.         DAC_data_w(2,crowd_mask);
  169.     else
  170.         DAC_data_w(2,0);
  171.  
  172.     if (!noise_timer_set)
  173.         timer_set (TIME_IN_NSEC(TIME_256H), 0, atarifb_noise_256H);
  174.     noise_timer_set=1;
  175.  
  176.     coin_counter_w (0, data & 0x10);
  177. //    logerror("out2_w: %02x\n", data & ~0x0f);
  178. }
  179.  
  180. static WRITE_HANDLER( soccer_out2_w )
  181. {
  182.     /* D0-D3 = crowd */
  183.     crowd_mask = (data & 0x0F) << 4;
  184.     if (noise)
  185.         DAC_data_w(2,crowd_mask);
  186.     else
  187.         DAC_data_w(2,0);
  188.  
  189.     if (!noise_timer_set)
  190.         timer_set (TIME_IN_NSEC(TIME_256H), 0, atarifb_noise_256H);
  191.     noise_timer_set=1;
  192.  
  193.     coin_counter_w (0, data & 0x40);
  194.     coin_counter_w (1, data & 0x20);
  195.     coin_counter_w (2, data & 0x10);
  196. //    logerror("out2_w: %02x\n", data & ~0x0f);
  197. }
  198.  
  199. static WRITE_HANDLER( atarifb_out3_w )
  200. {
  201.     int loop = cpu_getiloops ();
  202.  
  203.     switch (loop)
  204.     {
  205.         case 0x00:
  206.             /* Player 1 play select lamp */
  207.             atarifb_lamp1 = data;
  208.             break;
  209.         case 0x01:
  210.             break;
  211.         case 0x02:
  212.             /* Player 2 play select lamp */
  213.             atarifb_lamp2 = data;
  214.             break;
  215.         case 0x03:
  216.             break;
  217.     }
  218. //    logerror("out3_w, %02x:%02x\n", loop, data);
  219. }
  220.  
  221. static struct MemoryReadAddress readmem[] =
  222. {
  223.     { 0x0000, 0x03ff, MRA_RAM },
  224.     { 0x1000, 0x13bf, MRA_RAM },
  225.     { 0x13c0, 0x13ff, MRA_RAM },
  226.     { 0x3000, 0x3000, MRA_RAM },
  227.     { 0x4000, 0x4000, atarifb_in0_r },
  228.     { 0x4002, 0x4002, atarifb_in2_r },
  229.     { 0x6000, 0x7fff, MRA_ROM }, /* PROM */
  230.     { 0xfff0, 0xffff, MRA_ROM }, /* PROM for 6502 vectors */
  231.     { -1 }    /* end of table */
  232. };
  233.  
  234. static struct MemoryWriteAddress writemem[] =
  235. {
  236.     { 0x0000, 0x01ff, MWA_RAM },
  237.     { 0x0200, 0x025f, atarifb_alphap1_vram_w, &atarifb_alphap1_vram, &atarifb_alphap1_vram_size },
  238.     { 0x0260, 0x039f, MWA_RAM },
  239.     { 0x03a0, 0x03ff, atarifb_alphap2_vram_w, &atarifb_alphap2_vram, &atarifb_alphap2_vram_size },
  240.     { 0x1000, 0x13bf, videoram_w, &videoram, &videoram_size },
  241.     { 0x13c0, 0x13ff, MWA_RAM, &spriteram, &spriteram_size },
  242.     { 0x2000, 0x2000, atarifb_scroll_w, &atarifb_scroll_register }, /* OUT 0 */
  243.     { 0x2001, 0x2001, atarifb4_out1_w }, /* OUT 1 */
  244.     { 0x2002, 0x2002, atarifb_out2_w }, /* OUT 2 */
  245.     { 0x2003, 0x2003, atarifb_out3_w }, /* OUT 3 */
  246.     { 0x3000, 0x3000, MWA_NOP }, /* Interrupt Acknowledge */
  247.     { 0x5000, 0x5000, watchdog_reset_w },
  248.     { 0x6000, 0x7fff, MWA_ROM }, /* PROM */
  249.     { -1 }    /* end of table */
  250. };
  251.  
  252. static struct MemoryReadAddress atarifb4_readmem[] =
  253. {
  254.     { 0x0000, 0x03ff, MRA_RAM },
  255.     { 0x1000, 0x13bf, MRA_RAM },
  256.     { 0x13c0, 0x13ff, MRA_RAM },
  257.     { 0x3000, 0x3000, MRA_RAM },
  258.     { 0x4000, 0x4000, atarifb4_in0_r },
  259.     { 0x4001, 0x4001, input_port_1_r },
  260.     { 0x4002, 0x4002, atarifb4_in2_r },
  261.     { 0x6000, 0x7fff, MRA_ROM }, /* PROM */
  262.     { 0xfff0, 0xffff, MRA_ROM }, /* PROM for 6502 vectors */
  263.     { -1 }    /* end of table */
  264. };
  265.  
  266. static struct MemoryWriteAddress atarifb4_writemem[] =
  267. {
  268.     { 0x0000, 0x01ff, MWA_RAM },
  269.     { 0x0200, 0x025f, atarifb_alphap1_vram_w, &atarifb_alphap1_vram, &atarifb_alphap1_vram_size },
  270.     { 0x0260, 0x039f, MWA_RAM },
  271.     { 0x03a0, 0x03ff, atarifb_alphap2_vram_w, &atarifb_alphap2_vram, &atarifb_alphap2_vram_size },
  272.     { 0x1000, 0x13bf, videoram_w, &videoram, &videoram_size },
  273.     { 0x13c0, 0x13ff, MWA_RAM, &spriteram, &spriteram_size },
  274.     { 0x2000, 0x2000, atarifb_scroll_w, &atarifb_scroll_register }, /* OUT 0 */
  275.     { 0x2001, 0x2001, atarifb_out1_w }, /* OUT 1 */
  276.     { 0x2002, 0x2002, atarifb_out2_w }, /* OUT 2 */
  277.     { 0x2003, 0x2003, atarifb_out3_w }, /* OUT 3 */
  278.     { 0x3000, 0x3000, MWA_NOP }, /* Interrupt Acknowledge */
  279.     { 0x5000, 0x5000, watchdog_reset_w },
  280.     { 0x6000, 0x7fff, MWA_ROM }, /* PROM */
  281.     { -1 }    /* end of table */
  282. };
  283.  
  284. static struct MemoryReadAddress soccer_readmem[] =
  285. {
  286.     { 0x0000, 0x03ff, MRA_RAM },
  287.     { 0x0800, 0x0bff, MRA_RAM },    /* playfield/object RAM */
  288.     { 0x2000, 0x3fff, MRA_ROM }, /* PROM */
  289.     { 0x1800, 0x1800, atarifb4_in0_r },
  290.     { 0x1801, 0x1801, input_port_1_r },
  291.     { 0x1802, 0x1802, atarifb4_in2_r },
  292.     { 0x1803, 0x1803, input_port_11_r },
  293.     { 0xfff0, 0xffff, MRA_ROM }, /* PROM for 6502 vectors */
  294.     { -1 }    /* end of table */
  295. };
  296.  
  297. static struct MemoryWriteAddress soccer_writemem[] =
  298. {
  299.     { 0x0000, 0x01ff, MWA_RAM },
  300.     { 0x0200, 0x025f, atarifb_alphap1_vram_w, &atarifb_alphap1_vram, &atarifb_alphap1_vram_size },
  301.     { 0x0260, 0x039f, MWA_RAM },
  302.     { 0x03a0, 0x03ff, atarifb_alphap2_vram_w, &atarifb_alphap2_vram, &atarifb_alphap2_vram_size },
  303.     { 0x0800, 0x0bbf, videoram_w, &videoram, &videoram_size },
  304.     { 0x0bc0, 0x0bff, MWA_RAM, &spriteram, &spriteram_size },
  305.     { 0x1000, 0x1000, atarifb_scroll_w, &atarifb_scroll_register }, /* OUT 0 */
  306.     { 0x1001, 0x1001, soccer_out1_w }, /* OUT 1 */
  307.     { 0x1002, 0x1002, soccer_out2_w }, /* OUT 2 */
  308.     { 0x1004, 0x1004, MWA_NOP }, /* Interrupt Acknowledge */
  309.     { 0x1005, 0x1005, watchdog_reset_w },
  310.     { 0x2000, 0x3fff, MWA_ROM }, /* PROM */
  311.     { -1 }    /* end of table */
  312. };
  313.  
  314.  
  315. INPUT_PORTS_START( atarifb )
  316.     PORT_START        /* IN0 */
  317.     PORT_BIT ( 0x0F, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  318.     PORT_BIT ( 0x10, IP_ACTIVE_LOW,  IPT_BUTTON1 )
  319.     PORT_BIT ( 0x20, IP_ACTIVE_LOW,  IPT_TILT )
  320.     PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
  321.     PORT_BIT ( 0x80, IP_ACTIVE_LOW,  IPT_COIN1 )
  322.  
  323.     PORT_START        /* IN1 */
  324.     PORT_DIPNAME( 0x03, 0x00, "Time per coin" )
  325.     PORT_DIPSETTING(    0x00, "1:30" )
  326.     PORT_DIPSETTING(    0x01, "2:00" )
  327.     PORT_DIPSETTING(    0x02, "2:30" )
  328.     PORT_DIPSETTING(    0x03, "3:00" )
  329.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  330.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  331.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  332.     PORT_DIPNAME( 0x08, 0x00, "Atari logo" )
  333.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  334.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  335.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  336.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  337.     PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
  338.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
  339.  
  340.     PORT_START    /* IN2 - Player 1 trackball, y */
  341.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE, 100, 10, 0, 0 )
  342.     /* The lower 4 bits are the input */
  343.  
  344.     PORT_START    /* IN3 - Player 1 trackball, x */
  345.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X, 100, 10, 0, 0 )
  346.     /* The lower 4 bits are the input */
  347.  
  348.     PORT_START    /* IN4 - Player 2 trackball, y */
  349.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE | IPF_PLAYER2, 100, 10, 0, 0 )
  350.     /* The lower 4 bits are the input */
  351.  
  352.     PORT_START    /* IN5 - Player 2 trackball, x */
  353.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER2, 100, 10, 0, 0 )
  354.     /* The lower 4 bits are the input */
  355. INPUT_PORTS_END
  356.  
  357. INPUT_PORTS_START( atarifb4 )
  358.     PORT_START        /* IN0 */
  359.     PORT_BIT ( 0xff, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  360.  
  361.     PORT_START        /* IN1 */
  362.     PORT_BIT ( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
  363.     PORT_BIT ( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
  364.     PORT_BIT ( 0x04, IP_ACTIVE_LOW,  IPT_COIN3 )
  365.     PORT_BIT ( 0x38, IP_ACTIVE_LOW, IPT_UNKNOWN )
  366.     PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
  367.     PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  368.  
  369.     PORT_START        /* IN2 */
  370.     PORT_DIPNAME( 0x03, 0x00, "Time per coin" )
  371.     PORT_DIPSETTING(    0x00, "1:30" )
  372.     PORT_DIPSETTING(    0x01, "2:00" )
  373.     PORT_DIPSETTING(    0x02, "2:30" )
  374.     PORT_DIPSETTING(    0x03, "3:00" )
  375.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  376.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  377.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  378.     PORT_DIPNAME( 0x08, 0x00, "Atari logo" )
  379.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  380.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  381.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_START1 )
  382.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_TILT )
  383.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  384.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  385.  
  386.     PORT_START    /* IN3 - Player 1 trackball, y */
  387.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE, 100, 10, 0, 0 )
  388.     /* The lower 4 bits are the input */
  389.  
  390.     PORT_START    /* IN4 - Player 1 trackball, x */
  391.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X, 100, 10, 0, 0 )
  392.     /* The lower 4 bits are the input */
  393.  
  394.     PORT_START    /* IN5 - Player 2 trackball, y */
  395.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE | IPF_PLAYER2, 100, 10, 0, 0 )
  396.     /* The lower 4 bits are the input */
  397.  
  398.     PORT_START    /* IN6 - Player 2 trackball, x */
  399.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER2, 100, 10, 0, 0 )
  400.     /* The lower 4 bits are the input */
  401.  
  402.     PORT_START    /* IN7 - Player 3 trackball, y */
  403.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE | IPF_PLAYER3, 100, 10, 0, 0 )
  404.     /* The lower 4 bits are the input */
  405.  
  406.     PORT_START    /* IN8 - Player 3 trackball, x */
  407.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER3, 100, 10, 0, 0 )
  408.     /* The lower 4 bits are the input */
  409.  
  410.     PORT_START    /* IN9 - Player 4 trackball, y */
  411.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE | IPF_PLAYER4, 100, 10, 0, 0 )
  412.     /* The lower 4 bits are the input */
  413.  
  414.     PORT_START    /* IN10 - Player 4 trackball, x */
  415.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER4, 100, 10, 0, 0 )
  416.     /* The lower 4 bits are the input */
  417. INPUT_PORTS_END
  418.  
  419. INPUT_PORTS_START( abaseb )
  420.     PORT_START        /* IN0 */
  421.     PORT_BIT ( 0x0F, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  422.     PORT_BIT ( 0x10, IP_ACTIVE_LOW,  IPT_BUTTON1 )
  423.     PORT_BIT ( 0x20, IP_ACTIVE_LOW,  IPT_TILT )
  424.     PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
  425.     PORT_BIT ( 0x80, IP_ACTIVE_LOW,  IPT_COIN1 )
  426.  
  427.     PORT_START        /* IN1 */
  428.     PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
  429.     PORT_DIPSETTING(    0x00, "Hardest" )
  430.     PORT_DIPSETTING(    0x01, "Hard" )
  431.     PORT_DIPSETTING(    0x02, "Fair" )
  432.     PORT_DIPSETTING(    0x03, "Easy" )
  433.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  434.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  435.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  436.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  437.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  438.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  439.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  440.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  441.     PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
  442.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
  443.  
  444.     PORT_START    /* IN2 - Player 1 trackball, y */
  445.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE, 100, 10, 0, 0 )
  446.     /* The lower 4 bits are the input */
  447.  
  448.     PORT_START    /* IN3 - Player 1 trackball, x */
  449.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X, 100, 10, 0, 0 )
  450.     /* The lower 4 bits are the input */
  451.  
  452.     PORT_START    /* IN4 - Player 2 trackball, y */
  453.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE | IPF_PLAYER2, 100, 10, 0, 0 )
  454.     /* The lower 4 bits are the input */
  455.  
  456.     PORT_START    /* IN5 - Player 2 trackball, x */
  457.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER2, 100, 10, 0, 0 )
  458.     /* The lower 4 bits are the input */
  459. INPUT_PORTS_END
  460.  
  461. INPUT_PORTS_START( soccer )
  462.     PORT_START        /* IN0 */
  463.     PORT_BIT ( 0xff, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  464.  
  465.     PORT_START        /* IN1 */
  466.     PORT_BIT ( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN ) /* unused on schematics */
  467.     PORT_BIT ( 0x02, IP_ACTIVE_LOW,  IPT_COIN1 )
  468.     PORT_BIT ( 0x04, IP_ACTIVE_LOW,  IPT_COIN2 )
  469.     PORT_BIT ( 0x08, IP_ACTIVE_LOW,  IPT_COIN3 )
  470.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused on schematics */
  471.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_TILT )
  472.     PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
  473.     PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  474.  
  475.     PORT_START        /* IN2 */
  476.     PORT_DIPNAME( 0x01, 0x00, "2/4 Players" )
  477.     PORT_DIPSETTING(    0x00, "2" )
  478.     PORT_DIPSETTING(    0x01, "4" )
  479.     PORT_DIPNAME( 0x02, 0x00, "Rule Switch" )
  480.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  481.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  482.     PORT_DIPNAME( 0x0c, 0x00, "Language" )
  483.     PORT_DIPSETTING(    0x00, "English" )
  484.     PORT_DIPSETTING(    0x04, "German" )
  485.     PORT_DIPSETTING(    0x08, "French" )
  486.     PORT_DIPSETTING(    0x0c, "Spanish" )
  487.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
  488.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  489.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER4 )
  490.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  491.  
  492.     PORT_START    /* IN3 - Player 1 trackball, y */
  493.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE, 100, 10, 0, 0 )
  494.     /* The lower 4 bits are the input */
  495.  
  496.     PORT_START    /* IN4 - Player 1 trackball, x */
  497.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X, 100, 10, 0, 0 )
  498.     /* The lower 4 bits are the input */
  499.  
  500.     PORT_START    /* IN5 - Player 2 trackball, y */
  501.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE | IPF_PLAYER2, 100, 10, 0, 0 )
  502.     /* The lower 4 bits are the input */
  503.  
  504.     PORT_START    /* IN6 - Player 2 trackball, x */
  505.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER2, 100, 10, 0, 0 )
  506.     /* The lower 4 bits are the input */
  507.  
  508.     PORT_START    /* IN7 - Player 3 trackball, y */
  509.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE | IPF_PLAYER3, 100, 10, 0, 0 )
  510.     /* The lower 4 bits are the input */
  511.  
  512.     PORT_START    /* IN8 - Player 3 trackball, x */
  513.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER3, 100, 10, 0, 0 )
  514.     /* The lower 4 bits are the input */
  515.  
  516.     PORT_START    /* IN9 - Player 4 trackball, y */
  517.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_REVERSE | IPF_PLAYER4, 100, 10, 0, 0 )
  518.     /* The lower 4 bits are the input */
  519.  
  520.     PORT_START    /* IN10 - Player 4 trackball, x */
  521.     PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER4, 100, 10, 0, 0 )
  522.     /* The lower 4 bits are the input */
  523.  
  524.     PORT_START        /* IN11 */
  525.     PORT_DIPNAME( 0x07, 0x00, "Time per coin" )
  526.     PORT_DIPSETTING(    0x00, "1:00" )
  527.     PORT_DIPSETTING(    0x01, "1:20" )
  528.     PORT_DIPSETTING(    0x02, "1:40" )
  529.     PORT_DIPSETTING(    0x03, "2:00" )
  530.     PORT_DIPSETTING(    0x04, "2:30" )
  531.     PORT_DIPSETTING(    0x05, "3:00" )
  532.     PORT_DIPSETTING(    0x06, "3:30" )
  533.     PORT_DIPSETTING(    0x07, "4:00" )
  534.     PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coin_B ) )
  535.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  536.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_4C ) )
  537.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_5C ) )
  538.     PORT_DIPSETTING(    0x18, DEF_STR( 1C_6C ) )
  539.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Coin_A ) )
  540.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  541.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
  542.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
  543.     PORT_DIPSETTING(    0x00, "1 Coin Minimum" )
  544.     PORT_DIPSETTING(    0x40, "2 Coin Minimum" )
  545.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused on schematics */
  546. INPUT_PORTS_END
  547.  
  548.  
  549.  
  550.  
  551. static struct GfxLayout charlayout =
  552. {
  553.     8,8,    /* 8*8 characters */
  554.     64,     /* 64 characters */
  555.     1,        /* 1 bit per pixel */
  556.     { 0 },    /* no separation in 1 bpp */
  557.     { 15, 14, 13, 12, 7, 6, 5, 4 },
  558.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  559.     16*8    /* every char takes 16 consecutive bytes */
  560. };
  561.  
  562. static struct GfxLayout fieldlayout =
  563. {
  564.     8,8,    /* 8*8 characters */
  565.     64,     /* 64 characters */
  566.     1,        /* 1 bit per pixel */
  567.     { 0 },    /* no separation in 1 bpp */
  568.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  569.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  570.     8*8 /* every char takes 8 consecutive bytes */
  571. };
  572.  
  573. static struct GfxLayout soccer_fieldlayout =
  574. {
  575.     8,8,    /* 8*8 characters */
  576.     64,     /* 64 characters */
  577.     1,        /* 1 bit per pixel */
  578.     { 0 },    /* no separation in 1 bpp */
  579.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  580.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  581.     16*8    /* every char takes 16 consecutive bytes */
  582. };
  583.  
  584. static struct GfxLayout spritelayout =
  585. {
  586.     8,16,    /* 8*16 characters */
  587.     64,     /* 64 characters */
  588.     1,        /* 1 bit per pixel */
  589.     { 0 },    /* no separation in 1 bpp */
  590.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  591.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  592.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  593.     16*8 /* every char takes 16 consecutive bytes */
  594. };
  595.  
  596. static struct GfxLayout spritemasklayout =
  597. {
  598.     8,16,    /* 8*6 characters */
  599.     64,     /* 64 characters */
  600.     1,        /* 1 bit per pixel */
  601.     { 0 },    /* no separation in 1 bpp */
  602.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  603.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  604.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  605.     16*8    /* every char takes 16 consecutive bytes */
  606. };
  607.  
  608. static struct GfxDecodeInfo gfxdecodeinfo[] =
  609. {
  610.     { REGION_GFX1, 0, &charlayout,  0x00, 0x01 }, /* offset into colors, # of colors */
  611.     { REGION_GFX2, 0, &fieldlayout, 0x02, 0x01 }, /* offset into colors, # of colors */
  612.     { -1 } /* end of array */
  613. };
  614.  
  615. static struct GfxDecodeInfo soccer_gfxdecodeinfo[] =
  616. {
  617.     { REGION_GFX1, 0x0000, &charlayout,         0x00, 0x01 }, /* offset into colors, # of colors */
  618.     { REGION_GFX3, 0x0400, &soccer_fieldlayout, 0x06, 0x01 }, /* offset into colors, # of colors */
  619.     { REGION_GFX2, 0x0000, &spritelayout,       0x02, 0x02 }, /* offset into colors, # of colors */
  620.     { REGION_GFX3, 0x0000, &spritemasklayout,   0x06, 0x03 }, /* offset into colors, # of colors */
  621.     { -1 } /* end of array */
  622. };
  623.  
  624. static unsigned char palette[] =
  625. {
  626.     0x00,0x00,0x00, /* black  */
  627.     0x80,0x80,0x80, /* grey  */
  628.     0xff,0xff,0xff, /* white  */
  629.     0x40,0x40,0x40, /* dark grey (?) - used in Soccer only */
  630. };
  631. static unsigned short colortable[] =
  632. {
  633.     0x02, 0x00, /* chars */
  634.     0x03, 0x02, /* sprites */
  635.     0x03, 0x00,
  636.     0x03, 0x01, /* sprite masks */
  637.     0x03, 0x00,
  638.     0x03, 0x02,
  639. };
  640. static void init_palette(unsigned char *game_palette, unsigned short *game_colortable,const unsigned char *color_prom)
  641. {
  642.     memcpy(game_palette,palette,sizeof(palette));
  643.     memcpy(game_colortable,colortable,sizeof(colortable));
  644. }
  645.  
  646.  
  647. static struct DACinterface dac_interface =
  648. {
  649.     3,
  650.     { 50, 50, 50 }
  651. };
  652.  
  653. static struct MachineDriver machine_driver_atarifb =
  654. {
  655.     /* basic machine hardware */
  656.     {
  657.         {
  658.             CPU_M6502,
  659.             750000,        /* 750 KHz */
  660.             readmem,writemem,0,0,
  661.             interrupt,4
  662.         }
  663.     },
  664.     60, 2037,    /* frames per second, vblank duration: 16.3ms * 1/8 = 2037.5. Is it 1/8th or 3/32nds? (1528?) */
  665. //    60, 1528,    /* frames per second, vblank duration: 16.3ms * 3/32 = 1528.125. Is it 1/8th or 3/32nds? (1528?) */
  666.     1,    /* single CPU, no need for interleaving */
  667.     0,
  668.  
  669.     /* video hardware */
  670.     38*8, 32*8, { 0*8, 38*8-1, 0*8, 32*8-1 },
  671.     gfxdecodeinfo,
  672.     sizeof(palette) / sizeof(palette[0]) / 3, sizeof(colortable) / sizeof(colortable[0]),
  673.     init_palette,
  674.  
  675.     VIDEO_TYPE_RASTER,
  676.     0,
  677.     atarifb_vh_start,
  678.     atarifb_vh_stop,
  679.     atarifb_vh_screenrefresh,
  680.  
  681.     /* sound hardware */
  682.     0,0,0,0,
  683.     {
  684.         {
  685.             SOUND_DAC,
  686.             &dac_interface
  687.         }
  688.     }
  689. };
  690.  
  691. static struct MachineDriver machine_driver_atarifb4 =
  692. {
  693.     /* basic machine hardware */
  694.     {
  695.         {
  696.             CPU_M6502,
  697.             750000,        /* 750 KHz */
  698.             atarifb4_readmem,atarifb4_writemem,0,0,
  699.             interrupt,4
  700.         }
  701.     },
  702.     60, 2037,    /* frames per second, vblank duration: 16.3ms * 1/8 = 2037.5. Is it 1/8th or 3/32nds? (1528?) */
  703. //    60, 1528,    /* frames per second, vblank duration: 16.3ms * 3/32 = 1528.125. Is it 1/8th or 3/32nds? (1528?) */
  704.     1,    /* single CPU, no need for interleaving */
  705.     0,
  706.  
  707.     /* video hardware */
  708.     38*8, 32*8, { 0*8, 38*8-1, 0*8, 32*8-1 },
  709.     gfxdecodeinfo,
  710.     sizeof(palette) / sizeof(palette[0]) / 3, sizeof(colortable) / sizeof(colortable[0]),
  711.     init_palette,
  712.  
  713.     VIDEO_TYPE_RASTER,
  714.     0,
  715.     atarifb_vh_start,
  716.     atarifb_vh_stop,
  717.     atarifb_vh_screenrefresh,
  718.  
  719.     /* sound hardware */
  720.     0,0,0,0,
  721.     {
  722.         {
  723.             SOUND_DAC,
  724.             &dac_interface
  725.         }
  726.     }
  727. };
  728.  
  729. static struct MachineDriver machine_driver_soccer =
  730. {
  731.     /* basic machine hardware */
  732.     {
  733.         {
  734.             CPU_M6502,
  735.             750000,        /* 750 KHz */
  736.             soccer_readmem, soccer_writemem,0,0,
  737.             interrupt,4
  738.         }
  739.     },
  740.     60, 2037,    /* frames per second, vblank duration: 16.3ms * 1/8 = 2037.5. Is it 1/8th or 3/32nds? (1528?) */
  741. //    60, 1528,    /* frames per second, vblank duration: 16.3ms * 3/32 = 1528.125. Is it 1/8th or 3/32nds? (1528?) */
  742.     1,    /* single CPU, no need for interleaving */
  743.     0,
  744.  
  745.     /* video hardware */
  746.     38*8, 32*8, { 0*8, 38*8-1, 0*8, 32*8-1 },
  747.     soccer_gfxdecodeinfo,
  748.     sizeof(palette) / sizeof(palette[0]) / 3, sizeof(colortable) / sizeof(colortable[0]),
  749.     init_palette,
  750.  
  751.     VIDEO_TYPE_RASTER,
  752.     0,
  753.     atarifb_vh_start,
  754.     atarifb_vh_stop,
  755.     atarifb_vh_screenrefresh,
  756.  
  757.     /* sound hardware */
  758.     0,0,0,0,
  759.     {
  760.         {
  761.             SOUND_DAC,
  762.             &dac_interface
  763.         }
  764.     }
  765. };
  766.  
  767.  
  768. /***************************************************************************
  769.  
  770.   Game ROMs
  771.  
  772. ***************************************************************************/
  773.  
  774. ROM_START( atarifb )
  775.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code */
  776.     ROM_LOAD( "03302602.m1", 0x6800, 0x0800, 0x352e35db )
  777.     ROM_LOAD( "03302801.p1", 0x7000, 0x0800, 0xa79c79ca )
  778.     ROM_LOAD( "03302702.n1", 0x7800, 0x0800, 0xe7e916ae )
  779.     ROM_RELOAD(                 0xf800, 0x0800 )
  780.  
  781.     ROM_REGION( 0x0400, REGION_GFX1 | REGIONFLAG_DISPOSE )
  782.     ROM_LOAD_NIB_LOW ( "033029.n7", 0x0000, 0x0400, 0x12f43dca )
  783.  
  784.     ROM_REGION( 0x0200, REGION_GFX2 | REGIONFLAG_DISPOSE )
  785.     ROM_LOAD_NIB_LOW ( "033030.c5", 0x0000, 0x0200, 0xeac9ef90 )
  786.     ROM_LOAD_NIB_HIGH( "033031.d5", 0x0000, 0x0200, 0x89d619b8 )
  787. ROM_END
  788.  
  789. ROM_START( atarifb1 )
  790.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code */
  791.     ROM_LOAD( "03302601.m1", 0x6800, 0x0800, 0xf8ce7ed8 )
  792.     ROM_LOAD( "03302801.p1", 0x7000, 0x0800, 0xa79c79ca )
  793.     ROM_LOAD( "03302701.n1", 0x7800, 0x0800, 0x7740be51 )
  794.     ROM_RELOAD(                 0xf800, 0x0800 )
  795.  
  796.     ROM_REGION( 0x0400, REGION_GFX1 | REGIONFLAG_DISPOSE )
  797.     ROM_LOAD_NIB_LOW ( "033029.n7", 0x0000, 0x0400, 0x12f43dca )
  798.  
  799.     ROM_REGION( 0x0200, REGION_GFX2 | REGIONFLAG_DISPOSE )
  800.     ROM_LOAD_NIB_LOW ( "033030.c5", 0x0000, 0x0200, 0xeac9ef90 )
  801.     ROM_LOAD_NIB_HIGH( "033031.d5", 0x0000, 0x0200, 0x89d619b8 )
  802. ROM_END
  803.  
  804. ROM_START( atarifb4 )
  805.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code, the ROMs are nibble-wide */
  806.     ROM_LOAD_NIB_LOW ( "34889.m1", 0x6000, 0x0400, 0x5c63974a )
  807.     ROM_LOAD_NIB_HIGH( "34891.m2", 0x6000, 0x0400, 0x9d03baa1 )
  808.     ROM_LOAD_NIB_LOW ( "34890.n1", 0x6400, 0x0400, 0x2deb5844 )
  809.     ROM_LOAD_NIB_HIGH( "34892.n2", 0x6400, 0x0400, 0xad212d2d )
  810.     ROM_LOAD_NIB_LOW ( "34885.k1", 0x6800, 0x0400, 0xfdd272a1 )
  811.     ROM_LOAD_NIB_HIGH( "34887.k2", 0x6800, 0x0400, 0xfa2b8b52 )
  812.     ROM_LOAD_NIB_LOW ( "34886.l1", 0x6c00, 0x0400, 0xbe912ccb )
  813.     ROM_LOAD_NIB_HIGH( "34888.l2", 0x6c00, 0x0400, 0x3f8e96c1 )
  814.     ROM_LOAD_NIB_LOW ( "34877.e1", 0x7000, 0x0400, 0xfd8832fa )
  815.     ROM_LOAD_NIB_HIGH( "34879.e2", 0x7000, 0x0400, 0x7053ffbc )
  816.     ROM_LOAD_NIB_LOW ( "34878.f1", 0x7400, 0x0400, 0x329eb720 )
  817.     ROM_LOAD_NIB_HIGH( "34880.f2", 0x7400, 0x0400, 0xe0c9b4c2 )
  818.     ROM_LOAD_NIB_LOW ( "34881.h1", 0x7800, 0x0400, 0xd9055541 )
  819.     ROM_LOAD_NIB_HIGH( "34883.h2", 0x7800, 0x0400, 0x8a912448 )
  820.     ROM_LOAD_NIB_LOW ( "34882.j1", 0x7c00, 0x0400, 0x060c9cdb )
  821.     ROM_RELOAD_NIB_LOW (           0xfc00, 0x0400 ) /* for 6502 vectors */
  822.     ROM_LOAD_NIB_HIGH( "34884.j2", 0x7c00, 0x0400, 0xaa699a3a )
  823.     ROM_RELOAD_NIB_HIGH(           0xfc00, 0x0400 ) /* for 6502 vectors */
  824.  
  825.     ROM_REGION( 0x0400, REGION_GFX1 | REGIONFLAG_DISPOSE )
  826.     ROM_LOAD_NIB_LOW ( "033029.n7", 0x0000, 0x0400, 0x12f43dca )
  827.  
  828.     ROM_REGION( 0x0200, REGION_GFX2 | REGIONFLAG_DISPOSE )
  829.     ROM_LOAD_NIB_LOW ( "033030.c5", 0x0000, 0x0200, 0xeac9ef90 )
  830.     ROM_LOAD_NIB_HIGH( "033031.d5", 0x0000, 0x0200, 0x89d619b8 )
  831. ROM_END
  832.  
  833. ROM_START( abaseb )
  834.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code */
  835.     ROM_LOAD( "34738-01.n0", 0x6000, 0x0800, 0xedcfffe8 )
  836.     ROM_LOAD( "34737-03.m1", 0x6800, 0x0800, 0x7250863f )
  837.     ROM_LOAD( "34735-01.p1", 0x7000, 0x0800, 0x54854d7c )
  838.     ROM_LOAD( "34736-01.n1", 0x7800, 0x0800, 0xaf444eb0 )
  839.     ROM_RELOAD(              0xf800, 0x0800 )
  840.  
  841.     ROM_REGION( 0x0400, REGION_GFX1 | REGIONFLAG_DISPOSE )
  842.     ROM_LOAD_NIB_LOW ( "034710.d5", 0x0000, 0x0400, 0x31275d86 )
  843.  
  844.     ROM_REGION( 0x0200, REGION_GFX2 | REGIONFLAG_DISPOSE )
  845.     ROM_LOAD_NIB_LOW ( "034708.n7", 0x0000, 0x0200, 0x8a0f971b )
  846.     ROM_LOAD_NIB_HIGH( "034709.c5", 0x0000, 0x0200, 0x021d1067 )
  847. ROM_END
  848.  
  849. ROM_START( abaseb2 )
  850.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code, the ROMs are nibble-wide */
  851.     ROM_LOAD_NIB_LOW ( "034725.c0", 0x6000, 0x0400, 0x95912c58 )
  852.     ROM_LOAD_NIB_HIGH( "034723.m0", 0x6000, 0x0400, 0x5eb1597f )
  853.     ROM_LOAD_NIB_LOW ( "034726.b0", 0x6400, 0x0400, 0x1f8d506c )
  854.     ROM_LOAD_NIB_HIGH( "034724.l0", 0x6400, 0x0400, 0xecd18ed2 )
  855.     ROM_LOAD_NIB_LOW ( "034721.d1", 0x6800, 0x0400, 0x1a0541f2 )
  856.     ROM_LOAD_NIB_HIGH( "034715.j1", 0x6800, 0x0400, 0xaccb96f5 ) /* created from 8-bit set */
  857.     ROM_LOAD_NIB_LOW ( "034722.d0", 0x6c00, 0x0400, 0xf9c1174e ) /* The code in these 2 differs */
  858.     ROM_LOAD_NIB_HIGH( "034716.j0", 0x6c00, 0x0400, 0xd5622749 ) /* from the 8-bit set */
  859.     ROM_LOAD_NIB_LOW ( "034717.e1", 0x7000, 0x0400, 0xc941f64b )
  860.     ROM_LOAD_NIB_HIGH( "034711.k1", 0x7000, 0x0400, 0xfab61782 )
  861.     ROM_LOAD_NIB_LOW ( "034718.e0", 0x7400, 0x0400, 0x3fe7dc1c )
  862.     ROM_LOAD_NIB_HIGH( "034712.k0", 0x7400, 0x0400, 0x0e368e1a )
  863.     ROM_LOAD_NIB_LOW ( "034719.h1", 0x7800, 0x0400, 0x85046ee5 )
  864.     ROM_LOAD_NIB_HIGH( "034713.f1", 0x7800, 0x0400, 0x0c67c48d )
  865.     ROM_LOAD_NIB_LOW ( "034720.h0", 0x7c00, 0x0400, 0x37c5f149 )
  866.     ROM_RELOAD_NIB_LOW (            0xfc00, 0x0400 ) /* for 6502 vectors */
  867.     ROM_LOAD_NIB_HIGH( "034714.f0", 0x7c00, 0x0400, 0x920979ea )
  868.     ROM_RELOAD_NIB_HIGH(            0xfc00, 0x0400 ) /* for 6502 vectors */
  869.  
  870.     ROM_REGION( 0x0400, REGION_GFX1 | REGIONFLAG_DISPOSE )
  871.     ROM_LOAD_NIB_LOW ( "034710.d5", 0x0000, 0x0400, 0x31275d86 )
  872.  
  873.     ROM_REGION( 0x0200, REGION_GFX2 | REGIONFLAG_DISPOSE )
  874.     ROM_LOAD_NIB_LOW ( "034708.n7", 0x0000, 0x0200, 0x8a0f971b )
  875.     ROM_LOAD_NIB_HIGH( "034709.c5", 0x0000, 0x0200, 0x021d1067 )
  876. ROM_END
  877.  
  878. ROM_START( soccer )
  879.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code, the ROMs are nibble-wide */
  880.     ROM_LOAD_NIB_LOW ( "035222.e1", 0x2000, 0x0400, 0x03ec6bce )
  881.     ROM_LOAD_NIB_HIGH( "035224.e2", 0x2000, 0x0400, 0xa1aeaa70 )
  882.     ROM_LOAD_NIB_LOW ( "035223.f1", 0x2400, 0x0400, 0x9c600726 )
  883.     ROM_LOAD_NIB_HIGH( "035225.f2", 0x2400, 0x0400, 0x2aa06521 )
  884.     ROM_LOAD_NIB_LOW ( "035226.h1", 0x2800, 0x0400, 0xd57c0cfb )
  885.     ROM_LOAD_NIB_HIGH( "035228.h2", 0x2800, 0x0400, 0x594574cb )
  886.     ROM_LOAD_NIB_LOW ( "035227.j1", 0x2c00, 0x0400, 0x4112b257 )
  887.     ROM_LOAD_NIB_HIGH( "035229.j2", 0x2c00, 0x0400, 0x412d129c )
  888.  
  889.     ROM_LOAD_NIB_LOW ( "035230.k1", 0x3000, 0x0400, 0x747f6e4a )
  890.     ROM_LOAD_NIB_HIGH( "035232.k2", 0x3000, 0x0400, 0x55f43e7f )
  891.     ROM_LOAD_NIB_LOW ( "035231.l1", 0x3400, 0x0400, 0xd584c199 )
  892.     ROM_LOAD_NIB_HIGH( "035233.l2", 0x3400, 0x0400, 0xb343f500 )
  893.     ROM_LOAD_NIB_LOW ( "035234.m1", 0x3800, 0x0400, 0x83524bb7 )
  894.     ROM_LOAD_NIB_HIGH( "035236.m2", 0x3800, 0x0400, 0xc53f4d13 )
  895.     ROM_LOAD_NIB_LOW ( "035235.n1", 0x3c00, 0x0400, 0xd6855b0e )
  896.     ROM_RELOAD_NIB_LOW (            0xfc00, 0x0400 ) /* for 6502 vectors */
  897.     ROM_LOAD_NIB_HIGH( "035237.n2", 0x3c00, 0x0400, 0x1d01b054 )
  898.     ROM_RELOAD_NIB_HIGH(            0xfc00, 0x0400 ) /* for 6502 vectors */
  899.  
  900.     ROM_REGION( 0x0400, REGION_GFX1 | REGIONFLAG_DISPOSE )
  901.     ROM_LOAD_NIB_LOW ( "035250.r2", 0x0000, 0x0400, 0x12f43dca ) /* characters */
  902.  
  903.     ROM_REGION( 0x0800, REGION_GFX2 | REGIONFLAG_DISPOSE )
  904.     ROM_LOAD_NIB_LOW ( "035247.n7", 0x0000, 0x0400, 0x3adb5f4e ) /* sprites */
  905.     ROM_LOAD_NIB_HIGH( "035248.m7", 0x0000, 0x0400, 0xa890cd48 )
  906.  
  907.     ROM_REGION( 0x0800, REGION_GFX3 | REGIONFLAG_DISPOSE )
  908.     ROM_LOAD( "035246.r6", 0x0000, 0x0800, 0x4a996136 ) /* spritemask - playfield */
  909. ROM_END
  910.  
  911.  
  912. void init_atarifb (void)
  913. {
  914.     /* Tell the video code to draw the plays for this version */
  915.     atarifb_game = 1;
  916. }
  917.  
  918. void init_atarifb4(void)
  919. {
  920.     /* Tell the video code to draw the plays for this version */
  921.     atarifb_game = 2;
  922. }
  923.  
  924. void init_abaseb(void)
  925. {
  926.     /* Tell the video code to draw the plays for this version */
  927.     atarifb_game = 3;
  928. }
  929.  
  930. void init_soccer(void)
  931. {
  932.     /* Tell the video code to draw the plays for this version */
  933.     atarifb_game = 4;
  934. }
  935.  
  936.  
  937.  
  938. GAME( 1978, atarifb,  0,       atarifb,  atarifb,  atarifb,  ROT0, "Atari", "Atari Football (revision 2)" )
  939. GAME( 1978, atarifb1, atarifb, atarifb,  atarifb,  atarifb,  ROT0, "Atari", "Atari Football (revision 1)" )
  940. GAME( 1979, atarifb4, atarifb, atarifb4, atarifb4, atarifb4, ROT0, "Atari", "Atari Football (4 players)" )
  941. GAME( 1979, abaseb,   0,       atarifb,  abaseb,   abaseb,   ROT0, "Atari", "Atari Baseball (set 1)" )
  942. GAME( 1979, abaseb2,  abaseb,  atarifb,  abaseb,   abaseb,   ROT0, "Atari", "Atari Baseball (set 2)" )
  943. GAME( 197?, soccer,   0,       soccer,   soccer,   soccer,   ROT0, "Atari", "Atari Soccer" )
  944.